﻿@*传入一组string，第一个显示未标题，之后其他的显示为面包屑*@
@{
    var crumbs = Th.PageHeaderCrumbs ?? new List<string>();
    var headerMenus = Th.PageHeaderMenus ?? new Dictionary<string, string>();
}
@if (crumbs != null)
{
    <!-- BEGIN PAGE HEADER-->
    <div class="row">
        <div class="col-md-12">
            <!-- BEGIN PAGE TITLE & BREADCRUMB-->
            <h3 class="page-title">
                @crumbs.FirstOrDefault()
            </h3>
            <ul class="page-breadcrumb breadcrumb">
                <!--下拉Action-->
                @if (headerMenus.Count > 0)
                {
                    <li class="btn-group">
                        <button type="button" class="btn blue dropdown-toggle" data-toggle="dropdown" data-hover="dropdown" data-delay="1000" data-close-others="true">
                            <span>
                                操作
                            </span>
                            <i class="fa fa-angle-down"></i>
                        </button>
                        <ul class="dropdown-menu pull-right" role="menu">
                            @foreach (var item in headerMenus)
                            {
                                <li>
                                    <a href="@item.Value">@item.Key</a>
                                </li>
                            }
                        </ul>
                    </li>
                }
                <!--下拉Action-->
                <!--面包屑-->
                @{
                    var list = crumbs.Skip(1).ToList();
                    list.Add(crumbs.FirstOrDefault());
                }
                @for (var i = 0; i < list.Count(); i++)
                {
                    if (i == 0)
                    {
                        <li>
                            <i class="fa fa-home"></i>
                            <a href="@Url.Action("Index", "Home")">@list[i]</a>
                            <i class="fa fa-angle-right"></i>
                        </li>
                    }
                    else if (i == list.Count() - 1)
                    {
                        <li>
                            <a href="#">@list[i]</a>
                        </li>
                    }
                    else
                    {
                        <li>
                            <a href="#">@list[i]</a>
                            <i class="fa fa-angle-right"></i>
                        </li>
                    }
                }
                <!--面包屑-->
            </ul>
            <!-- END PAGE TITLE & BREADCRUMB-->
        </div>
    </div>
    <!-- END PAGE HEADER-->
}